<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .popup-box {
            width: 0;
            height: 200px;
            margin-top: -200px;
            position: absolute;
            top: 300px;
            left: 100px;
        }

        .line {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 5px;
            height: 0;
            background-color: red;
        }

        .popup-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            background-color: blue;
        }


    </style>
</head>
<body>
<button onclick="handleClick(true)">显示</button>
<button onclick="handleClick(false)">隐藏</button>
<div class="popup-box" id="popupBox">
    <div class="line" id="line" style="width: 5px;height:0;"></div>
    <div class="popup-content" id="popupContent" style="width: 0;height:0;"></div>
</div>
</body>
<script src="./js/base.js"></script>
<script>
    function handleClick(flag) {
        if (flag) {
            let line = document.getElementById("line");
            My.animate(line,{height:200},10,function () {
                console.log("结果了")
                var popupContent = document.getElementById("popupContent");
                My.animate(popupContent,{width:300,height:100},10,function () {
                })
            })
        } else {
            document.getElementById("line").style.height = 0;
            var popupContent = document.getElementById("popupContent");
            popupContent.style.width = 0;
            popupContent.style.height = 0;
        }
    }
</script>
</html>